﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace We1
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                DropDownList1.Items.Add("福建");
                DropDownList1.Items.Add("浙江");
                DropDownList1.Items.Add("广东");
                DropDownList2.Items.Add("福州");
                DropDownList2.Items.Add("厦门");
                DropDownList2.Items.Add("泉州");
            }
        }
        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            DropDownList2.Items.Clear();
            if (DropDownList1.SelectedValue == "福建")
            {
                DropDownList2.Items.Add("福州");
                DropDownList2.Items.Add("厦门");
                DropDownList2.Items.Add("泉州");
            }
            else if (DropDownList1.SelectedValue == "浙江")
            {
                DropDownList2.Items.Add("杭州");
                DropDownList2.Items.Add("温州");
                DropDownList2.Items.Add("义乌");
            }
            else if (DropDownList1.SelectedValue == "广东")
            {
                DropDownList2.Items.Add("广州");
                DropDownList2.Items.Add("梅州");
                DropDownList2.Items.Add("潮州");
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (FileUpload1.HasFile)
            {
                string filename = FileUpload1.FileName;
                string url = Server.MapPath(filename);
                FileUpload1.SaveAs(url);
                Image1.ImageUrl = filename;
                Image1.Visible = true;
            }
            Literal1.Text = $"账号：{TextBox1.Text} 性别：{RadioButtonList1.SelectedValue} 爱好：{CheckBoxList1.SelectedValue} 籍贯：{DropDownList1.SelectedValue}省{DropDownList2.SelectedValue}市 其它信息：{TextBox4.Text}";
        }
    }
}